package com.sgb.kjwl.api.service;

import com.sgb.kjwl.model.entity.AskLeaseFactoryEntity;
import com.sgb.kjwl.model.entity.AskLeaseFarmEntity;
import com.sgb.kjwl.model.entity.AskLeaseLandEntity;
import com.sgb.kjwl.model.entity.BannerEntity;
import com.sgb.kjwl.model.entity.CompanyInvitationEntity;
import com.sgb.jicai.entity.FilterEntity;
import com.sgb.kjwl.model.entity.LeaseEntity;
import com.sgb.kjwl.model.entity.MachineDetailEntity;
import com.sgb.kjwl.model.entity.ParentAreaEntity;
import com.swgk.core.base.model.factory.BaseUrlInterceptor;
import com.swgk.core.view.entity.MenuEntity;
import com.swgk.core.util.PickSelectEntity;
import com.sgb.kjwl.model.entity.ProListEntity;
import com.sgb.kjwl.model.entity.PublishLeaseDataEntity;
import com.sgb.kjwl.model.entity.RentingEntity;
import com.sgb.kjwl.model.entity.lease.AskLeaseDetailEditEntity;
import com.sgb.kjwl.model.entity.lease.AskLeaseItemEntity;
import com.sgb.kjwl.model.entity.lease.AskLeaseSheBeiEntity;
import com.sgb.kjwl.model.entity.lease.AskLeaseSheBeiEntity3;
import com.sgb.kjwl.model.entity.lease.MyAskLeaseQutedEntity;
import com.sgb.kjwl.model.entity.request.LeaseAskFilterJson;
import com.sgb.kjwl.model.entity.supplier3.DictEntity3;
import com.sgb.kjwl.model.entity.user.AddMachineOutEntity;
import com.sgb.kjwl.model.entity.user.DictEntity;
import com.sgb.kjwl.model.entity.user.ServiceEntity;
import com.sgb.kjwl.model.entity.user.UnitEntity;
import com.swgk.core.base.model.entity.ListResponse;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.recyclerview.entity.BaseAreaEntity;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface MachineAPI {

    //机械页面banner
    @POST("v1/app/machinery/bannerList")
    Call<BaseEntity<List<BannerEntity>>> getBannerList();

    //机械页面分类列表
    @FormUrlEncoded
    @POST("v1/app/machinery/categoryList")
    Call<BaseEntity<List<MenuEntity>>> getCategoryList(@Field("areaCode") String areaCode);

    //机械页面求租列表
    @FormUrlEncoded
    @POST("v1/app/machinery/rentList")
    Call<BaseEntity<List<RentingEntity>>> getRentList(@Field("areaCode") String areaCode);

    //机械页面出租列表
    @FormUrlEncoded
    @POST("v1/app/machinery/wantList")
    Call<BaseEntity<List<LeaseEntity>>> getWantList(@Field("areaCode") String areaCode);

    //集采招采--一级分类
    @GET("v1/app/groupBuy/getSecondCategory")
    Call<BaseEntity<List<DictEntity3>>> getSecondCategory(@Query("parentNo") String id, @Query("groupBuyClass") String groupBuyClass);

    //求租大厅--类型集合
    @GET("v1/app/equiment/getAllCategory")
    Call<BaseEntity<List<AskLeaseItemEntity<List<AskLeaseItemEntity<List<AskLeaseItemEntity>>>>>>> getAllTypeList();

    //求租详情--查看报价(categoryType=0机械 1设备 2 车辆，3房产 4土地 5工厂)
    @POST("v1/app/mechanicalRent/getOfferImg")
    Call<BaseEntity<ProListEntity<List<MyAskLeaseQutedEntity>>>> getLeaseQutedList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("rentalSeekId") String rentalSeekId, @Query("categoryType") String categoryType);

    //我的报价-接受报价
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @GET("v1/app/mechanicalRent/acceptOffer")
    Call<BaseEntity> acceptOffer(@Query("rentalSeekId") String rentalSeekId, @Query("id") String id, @Query("categoryType") String categoryType);

    //我的报价-取消报价
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @GET("v1/app/quotement/cancelQuote")
    Call<BaseEntity> cancelQuote(@Query("no") String no);

    //求租大厅--列表(机械,设备,车辆,房产,土地,工厂,农机)
    @POST("v1/app/equiment/getAllList")
    Call<BaseEntity<ListResponse<List<AskLeaseSheBeiEntity>>>> getEquList(@Body Map map);

    //求租大厅--全部
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @POST("v1/app/leasepublic/getAskRentLeaseAll")
    Call<BaseEntity<ListResponse<List<AskLeaseSheBeiEntity>>>> getAskRentLeaseAll(@Body LeaseAskFilterJson leaseAskFilterJson);

//    //我的求租列表
//    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
//    @POST("v1/app/equiment/getAllMyList")
//    Call<BaseEntity<ProListEntity<List<AskLeaseSheBeiEntity2>>>> getMyEquList(@Body Map map);

    //求租大厅--一键报价
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @POST("v1/app/equiment/saveQuote")
    Call<BaseEntity> changMyQuote(@Body Map map);

    //求租大厅--编辑机械求租详情（暂未使用）
    @POST("v1/app/mechanical/rentSeekDetail")
    Call<BaseEntity<AskLeaseDetailEditEntity>> getMatchDetail(@Query("areacode") String code, @Query("id") String id);

    //求租大厅--机械，设备，车辆，房产 求租详情
   //替换 @GET("v1/app/equiment/getDetail")
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @GET("v1/app/equimentRent/detailRentSeek")
    Call<BaseEntity<PublishLeaseDataEntity>> getDeviceDetail(@Query("id") String id, @Query("categoryType") String categoryType);

    //求租大厅--删除
    @POST("v1/app/mechanicalRent/deleteReek")
    Call<BaseEntity> deteleMatch(@Body Map map);

    //求租大厅--忽略
    @GET("v1/app/mechanicalRent/deleteOffer")
    Call<BaseEntity> ignoreMatch(@Query("id") String id, @Query("updateTime") String updateTime, @Query("categoryType") String categoryType);

    //求租大厅--发布机械
    @POST("v1/app/mechanicalRent/mechanicalLeasing")
    Call<BaseEntity> pubMatch(@Body AskLeaseSheBeiEntity3 map);

    //求租大厅--发布设备
    @POST("v1/app/equimentRent/equimentLeasing")
    Call<BaseEntity> pubDevice(@Body AskLeaseSheBeiEntity3 map);

    //机械筛选列表：筛选列表的一级及二级类型
    @FormUrlEncoded
    @POST("v1/app/machinery/categoryList")
    Call<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getFilterType(@Field("areaCode") String areaCode);

    //机械筛选列表：筛选列表的分类属性
    @FormUrlEncoded
    @POST("v1/app/machinery/categoryAttributeForList")
    Call<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getFilterAttr(@Field("no") String no);

    //机械页面搜索热词
    @POST("v1/app/machinery/hotWord")
    Call<BaseEntity<List<String>>> getHotWord();

    //机械详情
    @FormUrlEncoded
    @POST("v1/app/machinery/RentDetail")
    Call<BaseEntity<MachineDetailEntity>> getDetail(@Field("id") String id);

    //机械详情--编辑详情
    @FormUrlEncoded
    @POST("v1/app/rentInfo/detail")
    Call<BaseEntity<AddMachineOutEntity>> getEditDetail(@Field("id") String id);

    //机械出租删除
    @POST("v1/app/rentInfo/delete")
    Call<BaseEntity> delMachineOutList(@Body Map map);

    //机械出租上下架
    @POST("v1/app/rentInfo/putOut")
    Call<BaseEntity> machineOutOnlineOrOff(@Body Map map);

    //获取所在地区二级三级
    @GET("v1/app/common/getAreaSecondAndThird")
    Call<BaseEntity<List<ParentAreaEntity<List<ParentAreaEntity>>>>> getAreaSecondAndThird(@Query("areaCode") String areacode);

    //获取所在地区二级三级(数据格式被改变)
    @GET("v1/app/common/getAreaSecondAndThird")
    Call<BaseEntity<List<BaseAreaEntity<List<BaseAreaEntity>>>>> getAreaSecondAndThird2(@Query("areaCode") String areacode);

    //机械求租-价格单位
    @GET("v1/app/mechanical/getUnit")
    Call<BaseEntity<List<UnitEntity>>> getUnit();

    //设备求租--价格单位
    @POST("v1/app/equiment/getRentpriceUnit")
    Call<BaseEntity<List<UnitEntity>>> getRentpriceUnit();

    //车辆求租--价格单位
    @GET("v1/app/vehiclRent/getNeedLeaseCarPrice")
    Call<BaseEntity<List<UnitEntity>>> getNeedLeaseCarPrice();

    //机械求租--价格单位
    @GET("v1/app/realNeedEstate/getEstatePriceUnit")
    Call<BaseEntity<List<UnitEntity>>> getEstatePriceUnit();

    //机械出租--价格单位
    @GET("v1/app/estate/getUnit")
    Call<BaseEntity<List<UnitEntity>>> getEstatePriceUnitNew();

    //机械出租--单位选择
    @GET("v1/app/rentInfo/unitList")
    Call<BaseEntity<List<DictEntity>>> getMachinePrice();

    //机械出租--时间单位
    @GET("v1/app/rentInfo/getUnitList")
    Call<BaseEntity<List<PickSelectEntity<List<PickSelectEntity>>>>> getMachineTimeUnit();

    //获取付款方式接口
    @GET("v1/app/equiment/getAllPayWay")
    Call<BaseEntity<List<DictEntity3>>> getAllPayWay();

    //求租大厅的发布
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @POST("v1/app/equimentRent/equimentLeasing")
    Call<BaseEntity> getequimentLeasing(@Body PublishLeaseDataEntity PublishLeaseDataEntity);

    //求租大厅的发布
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @POST("v1/app/equimentRent/equimentLeasing")
    Call<BaseEntity<String>> getequimentLeasing2(@Body PublishLeaseDataEntity PublishLeaseDataEntity);

    //获取客服
    @POST("v1/app/equipmentRent/getCustomerOrg")
    Call<BaseEntity<List<ServiceEntity>>> getCustomerOrg();

    //判断求租信息能否被报价（0机械 1设备 2 车辆，3房产 4土地 5工厂 6农机）
    @GET("v1/app/equiment/judgeQuote")
    Call<BaseEntity> judgeImValid(@Body Map map);

    //车辆分类数据
    @GET("v1/app/vehiclRent/getModelSelect")
    Call<BaseEntity<List<DictEntity3>>> getModelSelect();

    //车辆车系数据
    @GET("v1/app/vehiclRent/getCarSeries")
    Call<BaseEntity<List<DictEntity3>>> getCarSeries(@Query("brandNo") String brandNo);

    //判断能否交流
    @GET("v1/app/equipmentRent/judgeCompanyOrSelf")
    Call<BaseEntity> judgeCompanyOrSelf(@Query("createCompanyNo") String createCompanyNo, @Query("createUserNo") String createUserNo);

    //企业邀请
    @POST("v1/app/invitatio/addinvitation")
    Call<BaseEntity> addinvitation(@Body CompanyInvitationEntity entity);

    /************************************土地求租*************************************************/

    //土地求租-供电方式
    @GET("v1/app/AppRealLand/getPowerWay")
    Call<BaseEntity<List<DictEntity3>>> getPowerWay();

    //土地求租-机械作业方式
    @GET("v1/app/AppRealLand/getMechanicalWork")
    Call<BaseEntity<List<DictEntity3>>> getMechanicalWork();

    //土地求租-日照情况
    @GET("v1/app/AppRealLand/getSunshineSupply")
    Call<BaseEntity<List<DictEntity3>>> getSunshineSupply();

    //新增、编辑求租土地
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @POST("v1/app/AppRealLand/addOrupdate")
    Call<BaseEntity> addOrUpdate(@Body AskLeaseLandEntity entity);

    //获取土地求租发布详情
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @GET("v1/app/AppRealLand/getDetail")
    Call<BaseEntity<AskLeaseLandEntity>> getDetailLand(@Query("no") String no);

    /************************************工厂求租*************************************************/

    //工厂求租-获取办公区域、停车区域、住宿区域、卸货平台配置信息
    @GET("v1/app/factory/rentSeek/getHasNotConfig")
    Call<BaseEntity<List<DictEntity3>>> getHasNotConfig();

    //工厂求租-供水/供电配置
    @GET("v1/app/factory/rentSeek/getSupplyConfig")
    Call<BaseEntity<List<DictEntity3>>> getSupplyConfig();

    //工厂求租-新增、编辑
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @POST("v1/app/factory/rentSeek/addOrUpdate")
    Call<BaseEntity> addOrUpdateFactory(@Body AskLeaseFactoryEntity entity);

    //工厂求租-获取详情
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @GET("v1/app/factory/rentSeek/getDetail")
    Call<BaseEntity<AskLeaseFactoryEntity>> getDetailFactory(@Query("no") String no);


    /************************************农机求租*************************************************/

    //农机求租-新增、编辑
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @POST("v1/app/farmMachinery/rentSeek/addOrUpdate")
    Call<BaseEntity> addOrUpdateFarm(@Body AskLeaseFarmEntity entity);

    //农机获取详情信息
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL, "tokenType:pc"})
    @GET("v1/app/farmMachinery/rentSeek/getDetail")
    Call<BaseEntity<AskLeaseFarmEntity>> getDetailFarm(@Query("no") String no);


}
